package wsz.service;

import wsz.dao.UserDao;
import wsz.pojo.User;

import java.util.List;

/**
 * @author wsz
 * @date 2021/10/13 13:43
 **/
public class UserServiceImpl implements  UserService {

    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public List<User> findAll() throws Exception {
        return userDao.findAll();
    }

    @Override
    public int update(User user) throws Exception {
        return userDao.update(user);
    }

    @Override
    public void updates(int i) throws Exception {

        User u1 = new User();
        u1.setId(2);
        u1.setName("222");
        u1.setPassword("222");
        userDao.update(u1);

        System.out.println(1/i);

        User u2 = new User();
        u2.setId(3);
        u2.setName("333");
        u2.setPassword("333");
        userDao.update(u2);
    }
}
